#ifndef XMEM_SM3_H
#define XMEM_SM3_H

#include <string.h>

#define SM3_DIGEST_LENGTH 32
#define SM3_BLOCK_SIZE 64
#define SM3_CBLOCK (SM3_BLOCK_SIZE)

typedef struct
{
	unsigned int digest[8];
	int nblocks;
	unsigned char block[64];
	int num;
} sm3_ctx_t;

void EasyXMen_sm3_init(sm3_ctx_t *ctx);
void EasyXMen_sm3_update(sm3_ctx_t *ctx, const unsigned char *data, size_t data_len);
void EasyXMen_sm3_final(sm3_ctx_t *ctx, unsigned char *digest);
void EasyXMen_sm3(const unsigned char *data, size_t datalen, unsigned char *dgst);

#endif /*XMEM_SM3_H*/
